package com.air.ota.vo;

import com.air.ota.util.HexStringUtil;

public class SZTDepositResultReqTransVO extends SZTBaseReqTransVO {
	
	public SZTDepositResultReqTransVO(byte[] deviceSequence, byte[] sztSequence,String deviceTriggerTime,
			byte[] cardAppSequence,byte[] depositResult,byte[] tac,
			byte[] cardRemain,byte[] cardTransSequence)
			throws Exception {
		super(deviceSequence, sztSequence,deviceTriggerTime);
		
		this.transTypeCode = 0x0C;
		this.subTransTypeCode = 0x10;
		//this.cardPhyType = 0x02;
		this.tranAppendCode = 0x03;
		
		this.cardAppSequence = cardAppSequence;
		this.depositResult = depositResult;
		this.tac = tac;
		this.cardRemain= cardRemain;
		this.cardTransSequence = cardTransSequence;
		
		this.transData  = makeTransData();
	}

	protected byte[] cardAppSequence;
	protected byte[] depositResult;
	protected byte[] tac;
	protected byte[] cardRemain;
	protected byte[] cardTransSequence;
	
	public byte[] makeTransData(){
		StringBuffer hexStringBuf = new StringBuffer();
		
		hexStringBuf.append(HexStringUtil.bytesToHexString(this.cardAppSequence));
		hexStringBuf.append(HexStringUtil.bytesToHexString(this.depositResult));
		hexStringBuf.append(HexStringUtil.bytesToHexString(this.tac));
		hexStringBuf.append(HexStringUtil.bytesToHexString(this.cardRemain));
		hexStringBuf.append(HexStringUtil.bytesToHexString(this.cardTransSequence));
		
		
		return HexStringUtil.hexStringToBytes(hexStringBuf.toString());
	}
	
}
